** PCE Deflator for The Effects of Changes in Local Bank Health on Household Consumption
** by Daniel Cooper and Joe Peek, ReStat 2020
/* ////////////////////////////////////////////////////////////////////////// */
clear all
set more off

/* This code constructs a PCE deflator
Based on when we started working on this project we used the PCE deflator with the 2000 base year.
The base year has been since updated a few times, but we stuck with a 2000 base year for consistency.
*/

* update the line below with the relevant path
local data "/shared/Joe_Peek/bankhealth_nocamels/data"

********************************************************************************
input year
	1968
	1969
	1970
	1971
	1972
	1973
	1974
	1975
	1976
	1977
	1978
	1979
	1980
	1981
	1982
	1983
	1984
	1985
	1986
	1987
	1988
	1989
	1990
	1991
	1992
	1993
	1994
	1995
	1996
	1997
	1998
	1999
	2000
	2001
	2002
	2003
	2004
	2005
	2006
	2007
	2008
	2009
	2010
	2011
	2012
	2013
	2014
	2015
	end	

g def = . 

replace         def        = 1.327026385 if year == 2015 
replace         def        = 1.308784523 if year == 2014
replace         def        = 1.291130866 if year == 2013
replace         def        = 1.275841744 if year == 2012
replace         def        = 1.252829871 if year == 2011
replace         def        = 1.22280497  if year == 2010
replace         def        = 1.202920691 if year == 2009
replace         def        = 1.20370259  if year == 2008
replace         def        = 1.16806005  if year == 2007
replace         def        = 1.139514742 if year == 2006
replace         def        = 1.109826659 if year == 2005
replace         def        = 1.079055948 if year == 2004
replace         def        = 1.053421708 if year == 2003
replace         def        = 1.032984085 if year == 2002
replace         def        = 1.019306877 if year == 2001
replace         def        = 1           if year == 2000
replace         def        = 0.975688973 if year == 1999
replace         def        = 0.961566684 if year == 1998
replace         def        = 0.954240897 if year == 1997
replace         def        = 0.938049584 if year == 1996
replace         def        = 0.918502123 if year == 1995
replace         def        = 0.899820765 if year == 1994
replace         def        = 0.881488253 if year == 1993
replace         def        = 0.860016119 if year == 1992
replace         def        = 0.83785832  if year == 1991
replace         def        = 0.811249714 if year == 1990
replace         def        = 0.777579964 if year == 1989
replace         def        = 0.745498069 if year == 1988
replace         def        = 0.717542192 if year == 1987
replace         def        = 0.696334701 if year == 1986
replace         def        = 0.681586893 if year == 1985
replace         def        = 0.658286319 if year == 1984
replace         def        = 0.634288051 if year == 1983
replace         def        = 0.608112497 if year == 1982
replace         def        = 0.576295245 if year == 1981
replace         def        = 0.529020462 if year == 1980
replace         def        = 0.477727923 if year == 1979
replace         def        = 0.438813439 if year == 1978
replace         def        = 0.410087693 if year == 1977
replace         def        = 0.385091001 if year == 1976
replace         def        = 0.365062371 if year == 1975
replace         def        = 0.336926056 if year == 1974
replace         def        = 0.305156921 if year == 1973
replace         def        = 0.28954301  if year == 1972
replace         def        = 0.279967762 if year == 1971
replace         def        = 0.268552044 if year == 1970
replace         def        = 0.256534867 if year == 1969
replace         def        = 0.245419879 if year == 1968

save `data'/pce_bh_def, replace 
